/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Validations;

import Services.exception.ServiceException;
import Services.ProductServices;
import beans.ProductBean;
import database.daos.DAOException;

/**
 *
 * @author Anthar
 */
public class ProductValidation {

    private ProductServices productService;

    public ProductValidation(){
        productService = new ProductServices();
    }

   
    public boolean existProduct(int idProduct) throws ServiceException, DAOException{
       final ProductBean product = getProductService().searchProduct(idProduct);
       if(product !=null){
                return true;
            }
        return false;
    }

    /********************
     * GETTERS Y SETTERS
     ********************/

    /**
     * @return the productService
     */
    public ProductServices getProductService() {
        return productService;
    }

    /**
     * @param productService the productService to set
     */
    public void setProductService(ProductServices productService) {
        this.productService = productService;
    }
}
